package mypackage3;

import java.util.ArrayList;
import java.util.Scanner;

public class UserTest {
    public static void main(String[] args) {
        ArrayList<User> list=new ArrayList<>();
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入用户个数");
        int number=sc.nextInt();
        for (int i = 0; i < number; i++) {
            User u=new User();
            System.out.println("请输入第一个用户的id");
            u.id=sc.next();
            System.out.println("请输入第一个用户的userName");
            u.userName=sc.next();
            System.out.println("请输入第一个用户的passWord");
            u.passWord=sc.next();
            list.add(u);
        }
        for (int i = 0; i < list.size(); i++) {
            User u=list.get(i);
            System.out.println("请输入第"+(i+1)+"个用户的id:"+u.id);
            System.out.println("请输入第"+(i+1)+"个用户的userName:"+u.userName);
            System.out.println("请输入第"+(i+1)+"个用户的passWord"+u.passWord);
        }
    }
}
